<{include file="header.html"}>
<{include file="top.html"}>
<div class="h_980 clearfix"> 
            <div class="FosfMain">
                <div id="checkoutPayment">
                <div class="page_dh"><a class="location-home" href="<{spUrl c=main a=index}>"></a> <a href="<{spUrl c=main a=CheckoutShipping}>"><{T w='Checkout'}></a> <{T w='NavigationJGF'}><{T w='Payment Method - Step 3'}></div>
                <input type="hidden" name="action" id="action" value="process" />
                <!-- bof Order Steps (tableless) -->
                    <div id="order_steps">
                            <div class="order_steps_text">
                			<span class="order_steps_text5"><{T w='Setp1Billing'}></span><span class="order_steps_text2"><{T w='Setp2Shipping'}></span><span id="active_step_text"><img src="<{$smarty.const.BASEPATH}>/css/img/arrow_checkout.gif" alt="<{T w='CheckoutALT'}>" title=" <{T w='CheckoutALT'}> " /><br /><{T w='Setp3Payment'}></span><span class="order_steps_text3"><{T w='Setp4Order Review'}></span><span class="order_steps_text4"><{T w='Setp5Order Complete'}></span>
                            </div>
                            <div class="order_steps_line_2">
                                <span class="progressbar_active">&nbsp;</span><span class="progressbar_active">&nbsp;</span><span class="progressbar_active">&nbsp;</span><span class="progressbar_inactive">&nbsp;</span><span class="progressbar_inactive">&nbsp;</span>
                            </div>
                    </div>
                <!-- eof Order Steps (tableless) -->
                
                <{if $smarty.session.payment_step eq ''}>
                <fieldset>
                <legend><{T w='Payment Method'}></legend>
                <{if $smarty.const.PAYPAL_EC_TYPE eq 'True'}>
                <input type="radio" name="payment" id="payment3" value="<{$smarty.const.PAYPAL_EC_CODE}>" <{if $smarty.const.DEFAULT_PAYMENT eq $smarty.const.PAYPAL_EC_CODE}>checked="checked"<{/if}>/> <label for="pmt-paypal" class="radioButtonLabel"><img src="https://www.paypal.com/en_US/i/logo/PayPal_mark_50x34.gif" alt="Click here to pay via PayPal Express Checkout" title="Click here to pay via PayPal Express Checkout" /> &nbsp;Checkout with PayPal. The safer, easier way to pay.</label>
                <br class="clear" />
                <{/if}>
                <{if $smarty.const.IPS_TYPE eq 'True'}>
                <input type="radio" name="payment" id="payment1" value="<{$smarty.const.IPS_CODE}>" <{if $smarty.const.DEFAULT_PAYMENT eq $smarty.const.IPS_CODE}>checked="checked"<{/if}>/> <label for="pmt-ips" class="radioButtonLabel"><img src="<{$smarty.const.WEBDIR}>images/ips.jpg" alt="Online Credit Card Processing" title="Online Credit Card Processing" /> &nbsp;<font color="red">(<{T w='VISA Supported Only'}>)</font></label>
                <br class="clear" />
                <{/if}>
                <{if $smarty.const.RPPAY_TYPE eq 'True'}>
                <input type="radio" name="payment" id="payment2" onclick="selectPayment(this)" value="<{$smarty.const.RPPAY_CODE}>" <{if $smarty.const.DEFAULT_PAYMENT eq $smarty.const.RPPAY_CODE}>checked="checked"<{/if}>/> <input type="hidden" value="0" name="<{$smarty.const.RPPAY_CODE}>" id="<{$smarty.const.RPPAY_CODE}>"/><label for="pmt-rppay" class="radioButtonLabel"><img src="https://www.billingcheckout.com/images/<{$smarty.const.RPPAY_SITEID}>.jpg" alt="Checkout with Rppay" title="Checkout with Rppay" /> &nbsp;<font color="red">(<{T w='VISA Supported Only'}>)</font></label>
                <br class="clear" />
                <{/if}>
                <{if $smarty.const.RPPAY_M_TYPE eq 'True'}>
                <input type="radio" name="payment" id="payment4" value="<{$smarty.const.RPPAY_M_CODE}>" <{if $smarty.const.DEFAULT_PAYMENT eq $smarty.const.RPPAY_M_CODE}>checked="checked"<{/if}>/><label for="pmt-rppay" class="radioButtonLabel"><img src="images/master.jpg" alt="Credit Card Payment(Master)" title="Credit Card Payment(Master)" /> &nbsp;<font color="red">(<{T w='Master Supported Only'}>)</font></label>
                <br class="clear" />
                <{/if}>
                <{if $smarty.const.WESTERNUNION_TYPE eq 'True'}>
                <input type="radio" name="payment" id="payment5" onclick="selectPayment(this)" value="<{$smarty.const.WESTERNUNION_CODE}>" <{if $smarty.const.DEFAULT_PAYMENT eq $smarty.const.WESTERNUNION_CODE}>checked="checked"<{/if}>/> <input type="hidden" value="<{$smarty.const.WESTERNUNION_MONEY*$count.count*$value}>" name="<{$smarty.const.WESTERNUNION_CODE}>" id="<{$smarty.const.WESTERNUNION_CODE}>"/><label for="pmt-westernunion" class="radioButtonLabel"><img src="<{$smarty.const.WEBDIR}>images/westernunion.jpg" alt=" Western Union to pay " title=" Western Union to pay " /> &nbsp;<font color="red">(<{T w='If you choose Western Union to pay'}>)</font></label>
                <br class="clear" />
                <{/if}>                
                </fieldset>
                <{/if}>
                
                <fieldset id="checkoutOrderTotals">
                <legend id="checkoutPaymentHeadingTotal"><{T w='Your Total'}></legend>
                    <div class="lineTitle"><strong><{T w='Subtotal'}>: </strong> +<{$symbol_left}><{$count.price2*$value}><input type="hidden" value="<{$count.price2*$value}>" name="subtotal" id="subtotal"/></div>
                   
                    <div class="lineTitle"><strong><{$selectshipping.2}>: </strong> +<{$symbol_left}><span id="shippingtxt"><{$selectshipping.1*$value}></span><input type="hidden" value="<{$selectshipping.1*$value}>" name="shipping" id="shipping"/></div>
                    <div class="lineTitle"><strong><{T w='Discount'}>: </strong> -<{$symbol_left}><span id="discounttxt">0</span></div>
                    <div class="lineTitle"><strong><{T w='Grand Total'}>: </strong> =<{$symbol_left}><span id="grandtotaltxt"><{($count.price2+$selectshipping.1)*$value}></span></div>
                
                </fieldset>
                
                <fieldset class="shipping">
                <legend><{T w='ShippingComments'}></legend>
                <textarea name="comments" id="comments" cols="45" rows="3"><{$smarty.session.comments}></textarea></fieldset>
                
                <div class="buttonRow forward"><input type="image" src="<{$smarty.const.BASEPATH}>/css/img/button_continue_checkout.gif" alt="<{T w='Continue'}>" title=" <{T w='Continue'}> " id="Continue" /></div>
                <div class="buttonRow back"><strong><{T w='Continue to Step 3'}></strong><br /><{T w='- to confirm your order.'}></div>
                
                
                <div id="waiting"></div>
                <script type="text/javascript">
                $(function(){ // 当页面加载完毕的时候
                
                 $("#Continue").click(
                 function(){
                     $("#waiting").css("display","block"); 
                     $("#waiting").ajaxStart(function(){$(this).html("<img src='<{$smarty.const.WEBDIR}>js/lightbox/css/lightbox-ico-loading.gif' alt='Loading...'/>");});
                	 var formdata = {
                    			'action' : $('#action').val(),
                    			'payment' : $("input[@type=radio][name='payment'][checked]").val(),
                    			'comments': $('#comments').val()
                		      };
                            //alert(" " + formdata.payment);
                            //alert($("input[@type=radio][name='payment'][checked]").val());
                            //alert($(":radio:checked").val());
                         
                	 $.getJSON("<{spUrl c=main a=CheckoutPayment}>", formdata, function(json){
                                if(json.status==1){
                                    $("#waiting").css("display","none");
                                    location.href="<{spUrl c=main a=CheckoutConfirmation}>"; 
                                }else{
                                    $(this).html(json.message);
                                    alert(" " + json.message);
                                }
                            }); 
                                
                });
                });
                function selectPayment(obj)
                {
                    
                    var Fobj='#'+obj.value;
                    var Fval=parseFloat($(Fobj).val());
                    var subtotal=parseFloat($('#subtotal').val());
                    var shipping=parseFloat($('#shipping').val());
                    var discount=Fval;
                    Fgrandtotal= subtotal+shipping-discount;
                    $('#discounttxt').html(Fval);
                    $('#grandtotaltxt').html(Fgrandtotal);
                }
                </script>
        </div>    
                   
                    
            <!--login template end-->
    </div><br class="clear"/>

 
</div>  
<{include file="footer.html"}>
</body>
</html>